
//
//  JWCalendarListViewModel.m
//  SiqiCalendar
//
//  Created by sunjiawen on 2018/4/9.
//  Copyright © 2018年 sjw. All rights reserved.
//

#import "JWCalendarListViewModel.h"
#import "JWRealmManager.h"
#import "JWCalendarModel.h"

@implementation JWCalendarListViewModel

- (void)loadDataWithBlock:(ModelListBlock)block {
    RLMResults *results = [[JWRealmManager defaultManager] queryAllCalendar];
    NSMutableArray *dataSource = [NSMutableArray array];
    for (JWCalendarModel *model in results) {
        [dataSource addObject:model];
    }
    
    if (block) {
        block(dataSource, nil);
    }
}


@end
